package com.chenglu.android.classify.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.classify.bean.ClassisyTreeBean;
import com.chenglu.android.common.utils.GlideUtils;


import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023 3 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：分类选项三
 */
public class ClassifyThreeAdapter extends BaseQuickAdapter<ClassisyTreeBean.Data.ChildrenX.Children, BaseViewHolder> {

    Context context;
//    List<HomeLike.Data.Records> data;
    public ClassifyThreeAdapter(Context context, @Nullable List<ClassisyTreeBean.Data.ChildrenX.Children> data) {
        super(R.layout.item_classify_three, data);
        this.context = context;

    }


    @Override
    protected void convert(@NonNull BaseViewHolder helper,ClassisyTreeBean.Data.ChildrenX.Children item) {

        if (item != null) {
//            LogUtils.v("searchadapter---" + item);

            TextView tvClassifyThree = helper.getView(R.id.tv_classify_three);

            tvClassifyThree.setText(item.getTitle());
//            LogUtils.d("图片和文字33333"+ item.getTitle() + " 图片地址333333" + item.getContent());
            ImageView ivThreeItem = helper.getView(R.id.iv_three_item);

            GlideUtils.setImageView(context,item.getContent(),ivThreeItem,1);
        }


    }
}
